package com.oocl.o2o.client.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.oocl.o2o.client.dao.OrderInfoDao;
import com.oocl.o2o.client.entity.OrderInfo;
import com.oocl.o2o.client.service.CustomerService;
import com.oocl.o2o.client.service.MerchantService;
import com.oocl.o2o.client.service.OrderInfoService;

/**
 * @description: 
 * @author  XIEMI2
 * @date Aug 12, 2017 10:14:37 AM
 * @version 1.0
 */
@Repository(value="orderInfoService")
public class OrderInfoServiceImpl implements OrderInfoService{

	@Resource(name="orderInfoDao")
	private OrderInfoDao orderInfoDao;
	@Resource
	private MerchantService merchantService;
	@Resource
	private CustomerService customerService;
	
	@Override
	public List<OrderInfo> findAll() {
		return orderInfoDao.findAll();
	}

	@Override
	@Transactional
	public OrderInfo add(OrderInfo orderInfo) {
		return orderInfoDao.add(orderInfo);
	}

	@Transactional
	@Override
	public OrderInfo delete(String id) {
		return orderInfoDao.delete(id);
	}
	
	@Transactional
	@Override
	public OrderInfo update(OrderInfo orderInfo) {
		return orderInfoDao.update(orderInfo);
	}

	@Override
	public OrderInfo findById(String orderInfoId) {
		return orderInfoDao.findById(orderInfoId);
	}

	@Override
	public List<OrderInfo> findByCustomerName(String customerName) {
		return orderInfoDao.findByCustomerName(customerName);
	}

	@Override
	public List<OrderInfo> findByCustomerId(String customerId) {
		return orderInfoDao.findByCustomerId(customerId);
	}
	
	@Transactional
	@Override
	public boolean updateOrderInfoStatus(String orderInfoId) {
		return orderInfoDao.updateOrderInfoStatus(orderInfoId);
	}

}


